package com.neibu.hw5.demo06;


import com.neibu.hw4.Student;

import java.util.function.Function;

/**
 * @author bin
 * @date 2025 - 04 -02
 **/
public class MainTest {
    public static void main(String[] args) {
        String str = "张三,18";

        Function<String, Student> function = s -> {
            String[] split = s.split(",");
            return new Student(split[0], Integer.parseInt(split[1]) + 1);
        };

        Student apply = function.apply(str);
        System.out.println(apply);
    }
}
